package ioc

type Builder struct {
	_Objs map[string]any
}

func NewBuilder() *Builder {
	return &Builder{_Objs: map[string]any{}}
}

// 注入依赖
func (_builder *Builder) Any(name string, obj any) {
	_builder._Objs[name] = obj
}

// 创建容器并返回
func (_builder *Builder) Build() *Container {
	return NewContainer(_builder._Objs)
}
